#ifndef TIMER_H
#define TIMER_H
#include "../core/node.h"
class timer:public node{
protected:
    float time = 0.0f;
    float interval = 3.0f;
    bool timeOut = false;
public:
    static timer* createTimer(node* parent,float interval);
    virtual void update(float dt) override;
    void setInterval(float interval_){interval = interval_;};
    float getInterval(){return interval;};
    float getProgress(){return time/interval;};
    float getTime(){return time;};
    void start(){setActive(true);}
    void stop(){setActive(false);}
    bool TimeOut();
};
#endif